package com.ruoyi.app.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.web.wuliu.domain.TSpecialLine;
import com.ruoyi.web.wuliu.service.ITSpecialLineService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 专线Controller
 * 
 * @author ruoyi
 * @date 2023-12-20
 */
@Api(tags = "小程序端-专线")
@RestController
@RequestMapping("/app/line")
public class AppTSpecialLineController extends BaseController
{
    @Autowired
    private ITSpecialLineService tSpecialLineService;

    /**
     * 查询专线列表
     */
    @ApiOperation("查询专线列表")
    @GetMapping("/list")
    public TableDataInfo list(TSpecialLine tSpecialLine)
    {
        startPage();
        List<TSpecialLine> list = tSpecialLineService.selectTSpecialLineList(tSpecialLine);
        return getDataTable(list);
    }

    /**
     * 获取专线详细信息
     */
    @ApiOperation("获取专线详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return success(tSpecialLineService.selectTSpecialLineById(id));
    }

    /**
     * 新增专线
     */
    @ApiOperation("新增专线")
    @PostMapping
    public AjaxResult add(@RequestBody TSpecialLine tSpecialLine)
    {
        return toAjax(tSpecialLineService.insertTSpecialLine(tSpecialLine));
    }

    /**
     * 修改专线
     */
    @ApiOperation("修改专线")
    @PutMapping
    public AjaxResult edit(@RequestBody TSpecialLine tSpecialLine)
    {
        return toAjax(tSpecialLineService.updateTSpecialLine(tSpecialLine));
    }

    /**
     * 删除专线
     */
    @ApiOperation("删除专线")
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(tSpecialLineService.deleteTSpecialLineByIds(ids));
    }
}
